home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
bailer.swf
/
scripts
/
DefineSprite_414
/
frame_1
/
DoAction.as
Wrap
Text File
|
2013-04-24
|
2KB
|
78 lines
function xStart()
{
specialDrop = -1;
switch(_parent.levelNo)
{
case 1:
DROP_WAIT = 50;
DROP_SKIP = 1;
DROP_RND = 10;
DROP_LIST = [20,45,35,0,0,0];
missCnt = 0;
break;
case 2:
DROP_WAIT = 30;
DROP_SKIP = 2;
DROP_RND = 20;
DROP_LIST = [20,35,30,10,0,5];
break;
case 3:
DROP_WAIT = 20;
DROP_SKIP = 1;
DROP_RND = 10;
DROP_LIST = [10,30,20,10,0,30];
if(missCnt <= 5)
{
specialDrop = 600 + Math.floor(Math.random() * 30 * 30);
}
}
trace(missCnt);
cnt = DROP_WAIT;
this.onEnterFrame = function()
{
if(_parent.gameState != 1)
{
return undefined;
}
if(specialDrop > 0)
{
specialDrop--;
}
if(--cnt <= 0)
{
cnt = DROP_SKIP;
if(specialDrop == 0)
{
specialDrop = -1;
this.xDropItem(5);
}
else if(Math.random() * 100 < DROP_RND)
{
cnt = DROP_WAIT;
var _loc5_ = Math.random() * 100;
var _loc4_ = 0;
var _loc3_ = 0;
while(_loc3_ < DROP_LIST.length)
{
_loc4_ += DROP_LIST[_loc3_];
if(_loc5_ < _loc4_)
{
break;
}
_loc3_ = _loc3_ + 1;
}
this.xDropItem(_loc3_ + 1);
}
}
};
}
function xDropItem(no)
{
var _loc3_ = Math.floor(Math.random() * Stage.width);
var _loc2_ = Math.floor(Math.random() * 50 + 50);
dp++;
iniObj = {_x:_loc3_,_y:_loc2_,no:no};
this.attachMovie("symItem","item" + dp,dp,iniObj);
}
dp = 0;